//
//  MusicModel.m
//  CarOfHome2
//
//  Created by dlios on 15/9/23.
//  Copyright (c) 2015年 lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "MusicModel.h"

@implementation MusicModel
- (void)setValuesForKeysWithDictionary:(NSDictionary *)keyedValues{
    [super setValuesForKeysWithDictionary:keyedValues];
    if ([[keyedValues objectForKey:@"name"] isEqual:[NSNull null]]) {
        self.name = @"";
        self.singerName = @"";
        self.favorites = @"";
        self.url = @"";
        self.duration = @"";
        self.picUrl = @"";
        self.songId = @"";
        self.singerId = @"";
    }
    else{
    if ([[keyedValues objectForKey:@"urlList"] count] == 0 || [[keyedValues objectForKey:@"urlList"] isEqual:[NSNull null]]) {
        self.url = @"";
    }
    else{
    
        self.url = [[[keyedValues objectForKey:@"urlList"] firstObject]objectForKey:@"url"];
    }
    if ([[keyedValues objectForKey:@"mvList"] count] == 0 || [[keyedValues objectForKey:@"urlList"] isEqual:[NSNull null]]) {
        self.picUrl = @"";
    }
    else{
    self.picUrl = [[[keyedValues objectForKey:@"mvList"] firstObject]objectForKey:@"picUrl"];
    }
    }
}

@end
